package crp.core.portal.domain.services;

import crp.core.portal.domain.models.PortalBannerEntity;
import crp.core.portal.domain.repositories.PortalBannerRepository;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import java.util.stream.Stream;

@ApplicationScoped
public class PortalBannerSearcher {
    private final PortalBannerRepository portalBannerRepository;

    @Inject
    public PortalBannerSearcher(PortalBannerRepository portalBannerRepository) {
        this.portalBannerRepository = portalBannerRepository;
    }

    public Stream<PortalBannerEntity> all() {
        return portalBannerRepository.findOrderedAll();
    }
}
